Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 - include non-dynamic pages in SEO fetching #697

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

mathiazom
Copy link
Contributor

@mathiazom mathiazom commented Sep 20, 2024

See #694

Currently, SEO data is not fetched for non-dynamic pages. This is becuase the query has a filter on the pageBuilder type. This has been changed to filter based on the existence of the seo field instead. This means that pages such as Compensations and CustomerCasePage also get SEO metadata.

CustomerCasePage was missing the seo fields, so this has also been added.

Checklist

Please ensure that you’ve completed the following checkpoints before submitting your pull request:

  • Documentation: Relevant documentation has been added or updated (if applicable).
  • Testing: Have you tested your changes thoroughly?

Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
variant-no ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 0:56am
variant-se-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 0:56am

@@ -77,7 +77,7 @@ export const SLUG_QUERY = groq`
`;

export const SEO_SLUG_QUERY = groq`
*[_type == "pageBuilder" && slug.current == $slug][0]{
*[defined(seo) && slug.current == $slug][0]{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would this transfer for documents where we don't have or want seo? I'm assuming the default SEO would then be the fallback? Say for Legal documents

Copy link
Contributor Author

@mathiazom mathiazom Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not change that behavior. Here we only say that any page with a field seo should use that data for SEO metadata, otherwise use default SEO. Opting out of SEO for a page, like legal documents, is not currently possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perff

@mathiazom mathiazom merged commit 5aed243 into v3 Sep 23, 2024
6 checks passed
@mathiazom mathiazom deleted the fix/v3-non-dynamic-pages-seo branch September 23, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants